<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <a href="javascript:;" target="_blank" id="link">百度</a>
    <script>
      var link = document.querySelector("#link");
      // link.addEventListener('click',function(e) {
      //     console.log('点击触发')

      //     e.preventDefault();
      // })
      //   link.onclick = function () {
      //     console.log("点击触发");
      //     return false;
      //   };
      //   link.addEventListener("click", function () {
      //     console.log("点击触发1");
      //     return false;
      //   });

      link.onclick = function (e) {
        console.log("点击触发111");
        // return false;
        e.preventDefault();
      };
    </script>
  </body>
</html>
